package com.wxx.main;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class MainCommons {

	public static void main(String[] args) throws InterruptedException {
		Calendar c = Calendar.getInstance();
		long time1 = c.getTimeInMillis();
		Thread.sleep(6000);
		c.setTime(new Date());
		long time2 = c.getTimeInMillis();
		System.out.println(">>>时间差>>>>"+(time2-time1));
		
	}

	public static String currDate(String pattern) {
		SimpleDateFormat format = new SimpleDateFormat(pattern);
		return format.format(currDate());
	}
	public static Date currDate() {
		return Calendar.getInstance().getTime();
	}
}